<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<%@ taglib prefix="system" tagdir="/WEB-INF/tags/system/"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<title>美瀛商旅-员工中心</title>

	<script src="${ctxPath}/resource/front/js/airLines.js" type="text/javascript"></script>
    <SCRIPT src="${ctxPath}/style/superValidator.js" type=text/javascript></SCRIPT>
	 <script type="text/javascript">
	 
		$(function() {
			$("#c_1").change(function() { 
			    if(this.value==2){
				    $("input[name='passengerIds']").each(function(){
				    			showEditTicket("num_"+$(this).val()+"","eticketNum"+$(this).val()+"","eticketNum"+$(this).val()+"");
				    });
			    } 
			});
			});
	 
	 //修改票号
	function showEditTicket(spanId,showId,eticketNum){
		document.getElementById(showId).style.display="inline";
		document.getElementById(spanId).style.display="none";
		$("#"+showId).attr("check",2);
	/* 	var code=$("#c_code").val().substring(0,2);
		if(code=='CZ'){
			$("#"+showId).attr("tip","票号开头为784长度为13位数字");
			$('#'+showId).tooltip();
			setCheckCZTicketNumber(""+eticketNum+"");
		}else if(code=='HU'){
			$("#"+showId).attr("tip","票号开头为880长度为13位数字");
			$('#'+showId).tooltip();
			setCheckHUTicketNumber(""+eticketNum+"");
		}else{ */
			$("#"+showId).attr("tip","票号长度为13位数字");
			$('#'+showId).tooltip();
			setCheckTicketNumber(""+eticketNum+"");
		//}
	 }; 
	 //修改证件号
	function showCardNum(spanId,showId,cardNum){
		document.getElementById(showId).style.display="inline";
		document.getElementById(spanId).style.display="none";
		$("#"+showId).attr("check",2);
		$("#"+showId).attr("tip","证件号不能为空");
		$('#'+showId).tooltip();
		setEmptyCheck(""+cardNum+"");
	 }
	 
	 //修改姓名
	function showPassengerName(spanId,showId,passengerName){
		document.getElementById(showId).style.display="inline";
		document.getElementById(spanId).style.display="none";
		$("#"+showId).attr("check",2);
		$("#"+showId).attr("tip","姓名不能为空");
		$('#'+showId).tooltip();
		setEmptyCheck(""+passengerName+"");
	 }
	 
	 
	 function showEditFlightDate(){
		 
		 document.getElementById("c_deptDay").style.display="inline";
			applyDate("c_deptDay");
		document.getElementById("hideStart").style.display="inline";
		applyTime("c_startDay");
		document.getElementById("hideEnd").style.display="inline";
		applyTime("c_arriDay");
		document.getElementById("flight_day").style.display="none";
		 
			$("#c_deptDay").attr("check",2);
			$("#c_startDay").attr("check",2);
			$("#c_arriDay").attr("check",2);
			$("#c_deptDay").attr("tip","出发日期不能为空");
			$("#c_startDay").attr("tip","出发时间不能为空");
			$("#c_startDay").attr("tip","到达时间不能为空");
			$('#c_deptDay').tooltip();
			$('#c_startDay').tooltip();
			$('#c_arriDay').tooltip();
			setEmptyCheck("c_deptDay:c_startDay:c_arriDay");
		 }; 
		 
		 
		 function showEditFlightCode(){
			 
			 document.getElementById("c_code").style.display="inline";
			 document.getElementById("change_code").style.display="none";
				$("#c_code").attr("check",2);
				$("#c_code").attr("tip","航班号不能为空");
				$('#c_code').tooltip();
				setEmptyCheck("c_code");
			 }; 
		 
	</script>
</head>

<body>
<!--内容-->
<form action="bOrders.do" method="post" >
<input type="hidden" name="cmd" value="doUpdateBorder"/>
<input type="hidden" name="id" value="${bOrder.id}"/>
    <ul>
          <li class="titleonly">
          <img src="${ctxPath}/css/style/base/image/dot.gif" width="15" height="16" class="dot" />&gt;&gt;国内订单信息查看 <a href="javascript:history.back()"><img src="${ctxPath}/css/style/base/image/backtrack.gif" width="14" height="14" align="absmiddle" class="backtrack"/>返回</a>
        </li>
        </ul>
        <ul>
      <div id="check_see">
<div id="check_top">
	<div id="title_c"><li>订单信息</li></div>
    <div id="content_c">
    <li class="w50">订单号：<strong>${bOrder.orderNo}</strong></li>
    <li class="w10"></li>
    <li class="w40">航程类型：<span><fmt:message key="bOrder.flightType${bOrder.flightType}"></fmt:message> </span></li>
    <li class="w50">订单状态：<span id="change_1"><fmt:message key="bOrder.status${bOrder.status}"></fmt:message> </span>
  
  	<system:statusOption id="c_1" display="false" value="${bOrder.status}" />
  
    <%-- <select name="orderStatus" class="inputbox130" id="c_1" style="display:none">
      <option value="8" <c:if test="${bOrder.status==9}">selected="selected"</c:if>>未出票申请退款</option>
      <option value="6" <c:if test="${bOrder.status==6}">selected="selected"</c:if>>订座成功等待价格确认</option>
      <option value="7" <c:if test="${bOrder.status==7}">selected="selected"</c:if>>等待座位确认</option>
      <option value="0" <c:if test="${bOrder.status==0}">selected="selected"</c:if>>订座成功等待支付</option>
      <option value="12" <c:if test="${bOrder.status==12}">selected="selected"</c:if>>订单取消</option>
      <option value="1" <c:if test="${bOrder.status==1}">selected="selected"</c:if>>支付成功等待出票</option>
      <option value="5" <c:if test="${bOrder.status==5}">selected="selected"</c:if>>出票中</option>
      <option value="2" <c:if test="${bOrder.status==2}">selected="selected"</c:if>>出票完成</option>
      <option value="40" <c:if test="${bOrder.status==40}">selected="selected"</c:if>>改签申请中</option>
      <option value="42" <c:if test="${bOrder.status==42}">selected="selected"</c:if>>改签完成</option>
      <option value="8" <c:if test="${bOrder.status==8}">selected="selected"</c:if>>退票申请中</option>
      <option value="31" <c:if test="${bOrder.status==31}">selected="selected"</c:if>>退票完成等待退款</option>
      <option value="39" <c:if test="${bOrder.status==39}">selected="selected"</c:if>>退款完成</option>
    </select> --%>
  	<a onclick='document.getElementById("c_1").style.display="inline";document.getElementById("change_1").style.display="none"' style="color:#09F;" >修改</a>
   </li>
    <li class="w10"></li>
    <li class="w40">订单来源：<span>${bOrder.source}</span></li>
    <li class="w50">pnr：<span id="change_2">${bOrder.pnr}</span>
     <input name="pnr" type="text" class="inputbox85" id="c_2" style="display:none" value="${bOrder.pnr}"/> 
    <a onclick='document.getElementById("c_2").style.display="inline";document.getElementById("change_2").style.display="none"' style="color:#09F;" >修改</a>
   </li>
    <li class="w10"></li>
    <li class="w40">匹配政策：<span style="color:#09F; font-weight:bold"><a href="${ctxPath}/admin/order/policys.do?cmd=viewDetail&policyId=${bOrder.policy.policyId}">${bOrder.policy.policyId}</a></span></li>
 
    <li class="w50">出票渠道：<span id="change_6">${bOrder.ticketChannel}</span>
    <input name="ticketChannel" class="inputbox120" value="${bOrder.ticketChannel}" type="text" id="c_6" style="display:none" /> 
	<a onclick='document.getElementById("c_6").style.display="inline";document.getElementById("change_6").style.display="none"' style="color:#09F;" >修改</a>
    </li>
    <li class="w10"></li>
    <li class="w40">出票方式：
    <span id="change_5">${bOrder.ticketMode}</span>
    <input name="ticketMode" class="inputbox85" type="text" id="c_5" style="display:none" /> 
	<a onclick='document.getElementById("c_5").style.display="inline";document.getElementById("change_5").style.display="none"' style="color:#09F;" >修改</a>
    </li>
  <!--   <li class="w50">保险订单号：<span>mei15161561351613813</span></li>
    <li class="w10"></li>
    <li class="w40">保险产品：<span>百年交通工具意外伤害保险</span></li> -->
    <li class="w50">订单金额：<span id="change_3">￥${bOrder.allPrice}</span>
	<input name="price" class="inputbox120" value="${bOrder.allPrice}" type="text" id="c_3" style="display:none" /> 
	<a onclick='document.getElementById("c_3").style.display="inline";document.getElementById("change_3").style.display="none"' style="color:#09F;" >修改</a>
    </li>
    <li class="w10"></li>
    <li class="w40">未支付金额：<span id="change_4">￥${bOrder.noPay}</span>
       <input name="noPay" class="inputbox85" type="text" id="c_4" style="display:none" value="${bOrder.noPay}"/> 
	<a onclick='document.getElementById("c_4").style.display="inline";document.getElementById("change_4").style.display="none"' style="color:#09F;" >修改</a>
    </li>
    <li class="w50">机票金额：<span>￥${bOrder.price}</span></li>
    <li class="w10"></li>
    <li class="w40">保险金额：<span>￥${bOrder.insuranceStatistics}</span></li>
      <c:if test="${bOrder.status==31}">
        <li class="w50">待退款金额：<span>￥${bOrder.price}</span></li>
          <li class="w10"></li>
        <li class="w40">退款备注：<span>${bOrder.remark}</span></li>
        </c:if>
<%--     <li class="w50">保险交易流水号：</li>
    <li class="w10"></li>
    <li class="w40">产品类型：<span>${bOrder.policy.policyId}</span></li> --%>
    <div id="clear"></div>
    </div>
</div>
	<div id="check_flight">
    	<div id="title_c">
            <li class="f150">航空公司</li>
            <li class="f60">航班号</li>
            <li class="f50">舱位</li>
            <li class="f30">机型</li>
            <li class="f100">航班时间</li>
            <li class="f120">起降机场</li>
            <li class="f40">里程</li>
            <li class="f60">飞行时间</li>
            <li class="f30">经停</li>
            <div id="clear"></div>
     	</div>
     	<c:forEach var="flight" items="${bOrder.flights}" varStatus="item">
        <div id="content_c">
            <li class="fc150"><img src="${ctxPath}/resource/front/js/airlineImage/${fn:substring(flight.code,0,2)}.gif" /><label id="flightName"></label></li>
            <script>
    		var carrier='${fn:substring(flight.code,0,2)}';
    		for(var i=0;i<airLines.length;i++){
    			if(carrier==airLines[i].code){
    				carrierName=airLines[i].name;
    				$("#flightName").text(carrierName);
    				break;
    			}
    		};
    		</script>
            <li class="fc80"><span id="change_code">${flight.code}</span>
               <input name="flightCode${flight.id}" class="inputbox40" type="text" id="c_code" style="display:none" value="${flight.code}"/> 
			<a onclick='' style="color:#09F;" >修改</a>
            <c:if test="${bOrder.status==40}">
                <script type="text/javascript">
                showEditFlightCode();
				</script>
				</c:if>
            </li>
            <li class="fc60">${flight.cabin}</li>
            <li class="fc30">--</li>
             <li class="fc130"><span id="flight_day">${flight.arrDay}<br />${flight.depTime}-${flight.arrTime}</span>
               <input name="c_deptDay${flight.id}" class="inputbox85" value="${flight.arrDay}"  style="width: 70px; type="text" id="c_deptDay" style="display:none" /> 
               <span style="display:none" id="hideStart"><br/>出发<input value="${flight.depTime}" class="inputbox85" style="width: 50px;" name="c_startDay${flight.id}" type="text" id="c_startDay"  /><br/></span>
		       <span style="display:none" id="hideEnd">到达<input  value="${flight.arrTime}" class="inputbox85" style="width: 50px;" name="c_arriDay${flight.id}" type="text" id="c_arriDay"  /></span>
			<a onclick='showEditFlightDate()'
			style="color:#09F;" ><br/>修改</a>
          	 <c:if test="${bOrder.status==40}">
                <script type="text/javascript">
                showEditFlightDate();
				</script>
				</c:if>
             </li>
             <li class="fc120">${flight.boardPointName}<br />${flight.offPointName}</li>
            <li class="fc60">${flight.mileage}公里</li>
            <li class="fc40">${flight.flightTime}分钟</li>
            <li class="fc60">${flight.stop}</li>
        </div>
        </c:forEach>
    </div>
	
    <div id="check_msg">
    	
       <div id="title_c">
            <li class="f100">旅客类型</li>
            <li class="f60">优惠价</li>
            <li class="f60">票面价</li>
            <li class="f40">机建</li>
            <li class="f40">燃油</li>
            <li class="f40">人数</li>
            <li class="f40">保险</li>
            <li class="f100">保险份数</li>
            <li class="f60">合计</li>
            <li class="f40">快递</li>
            <li class="f40">总价</li>
            <div id="clear"></div>
     	</div>
     	
     	<c:forEach var="passengerDto" items="${passengerDtos}" varStatus="item"> 
        <div id="content_c">
            <li class="fc100"><fmt:message key="passenger.ageType${passengerDto.passengerType}"></fmt:message></li>
            <li class="fc80"><span>￥<fmt:parseNumber value="${passengerDto.viewPrice}"></fmt:parseNumber></span></li>
            <li class="fc60"><span>￥<fmt:parseNumber value="${passengerDto.discountPrice}"></fmt:parseNumber></span></li>
            <li class="fc60"><span>￥<fmt:parseNumber value="${passengerDto.constructionFee}"></fmt:parseNumber></span></li>
            <li class="fc40"><span>￥<fmt:parseNumber value="${passengerDto.fuelTax}"></fmt:parseNumber></span></li>
            <li class="fc60"><span>${passengerDto.passengerCount}</span></li>
            <li class="fc40"><span>￥<fmt:parseNumber value="${passengerDto.bxPrice}"></fmt:parseNumber></span></li>
            <li class="fc120"><span><fmt:parseNumber value="${passengerDto.bxCount}"/></span></li>
            <li class="fc60"><span>￥<fmt:parseNumber value="${passengerDto.totalPrice*passengerDto.passengerCount}"/></span></li>
            <li class="fc60">
             <c:if test="${fn:length(passengerDtos)==item.count}">
            <span>${bOrder.xcdPrice}
            </span>
            </c:if>
            </li>
            <li class="fc40"><span style="color:#F36">
           	 <c:if test="${fn:length(passengerDtos)==item.count}">
          	  ￥<fmt:parseNumber value="${bOrder.allPrice}"/>
            </c:if></li>
            <div id="clear"></div>
        </div>
        </c:forEach>
    </div>
    	<div id="check_change">
        	<div id="title_c">
            <li>退改签说明：</li>
            </div>
            <div id="content_c">
            <li>${bOrder.backnote}</li>
            </div>
        </div>
			<div id="check_explain">
            	<div id="title_c">
                <li>舱位说明：</li>
                </div>
                <div id="content_c">
                <li>${bOrder.cabinnote}</li>
                </div>
            </div>
            
            <div id="check_guest">
            	<div id="title_c">
                <li>乘机人数：${fn:length(bOrder.passengers)}人</li>
                </div>
                <div id="content_c">
                <c:forEach var="passenger" items="${bOrder.passengers}" varStatus="item">
                <ul>
                <input name="passengerIds" value="${passenger.id}" type="hidden"/>
                <li class="w40">成人：<span id="passengerName_${passenger.id}">${passenger.name}</span>
                    <input name="passengerName${passenger.id}" type="text" id="passengerName${passenger.id}"  style="display:none" value="${passenger.name}"/> 
					<a onclick='showPassengerName("passengerName_${passenger.id}","passengerName${passenger.id}","passengerName${passenger.id}")' style="color:#09F;" >修改</a>
                </li>
                <li class="w40">身份证：<span id="cardNum_${passenger.id}">${passenger.cardNum}</span>
                  <input name="cardNum${passenger.id}" type="text" id="cardNum${passenger.id}"  style="display:none" value="${passenger.cardNum}"/> 
				  <a onclick='showCardNum("cardNum_${passenger.id}","cardNum${passenger.id}","cardNum${passenger.id}")' style="color:#09F;" >修改</a>
                </li>
                <li class="w20">票号:<span id="num_${passenger.id}">${passenger.eticketNum}</span> 
                <input name="eticketNum${passenger.id}" type="text" id="eticketNum${passenger.id}"  style="display:none" value="${passenger.eticketNum}"/> 
				<a onclick='showEditTicket("num_${passenger.id}","eticketNum${passenger.id}","eticketNum${passenger.id}")' style="color:#09F;" >修改</a>
                </li>
             <%--    <c:if test="${bOrder.status==5}">
                <script type="text/javascript">
               		 showEditTicket("num_${passenger.id}","eticketNum${passenger.id}","eticketNum${passenger.id}");
				</script> 
				</c:if>--%>
                <div id="clear"></div>
                </ul>
                <c:if test="${fn:length(passenger.insurances)>0}" >
                <ul>
                <li class="w70">保险公司：<span>${passenger.bxSource }</span></li>
                <li class="w20">保险价格：<span>${passenger.bxPrice}</span></li>
                <li class="w10">份数:<span>${fn:length(passenger.insurances)}</span></li>
                <div id="clear"></div>
                </ul>
                <ul>
                 <c:forEach var="insurance" items="${passenger.insurances }">
                <li class="w50">保单号：</li>
                 <li class="w50">状态：<span><fmt:message key="insurance.bxStatus${insurance.bxStatus}"/></span></li>
                <div id="clear"></div>
                </c:forEach>
                </ul>
                </c:if>
                <div id="clear"></div>
                </c:forEach>
                </div>
            </div>
            
            	<div id="check_linkman">
                    <div id="title_c">
                    <li>联系人：</li>
                    </div>
                    <div id="content_c">
                    <li class="w40">联系人：<span>${bOrder.contact}</span></li>
                    <li class="w30">手机：<span>${bOrder.contactMob}</span></li>
                    <li class="w30">电子邮件：${bOrder.contactEmail}</li>
                    <div id="clear"></div>
                    </div>
                </div>
                
                <div id="check_bx">
                    <div id="title_c">
                    <li>报销信息：</li>
                    </div>
                    <c:if test="${not empty bOrder.expType}">
                    <div id="content_c"> 
                    <li class="w40">快递方式：
                    <span id="change_expType"><fmt:message key="bOrder.expType${bOrder.expType}"></fmt:message> </span>
                    <input name="expType" type="text" class="inputbox85" id="c_expType" style="display:none" value="<fmt:message key="bOrder.expType${bOrder.expType}"></fmt:message>"/> 
					<!-- <a onclick='document.getElementById("c_expType").style.display="inline";document.getElementById("change_expType").style.display="none"' style="color:#09F;" >修改</a> -->
                    </li>
                    <li class="w30">快递公司：<span id="change_company">${bOrder.company}</span>
                     <input name="company" type="text" class="inputbox85" id="c_company" style="display:none" value="${bOrder.company}"/> 
					<a onclick='document.getElementById("c_company").style.display="inline";document.getElementById("change_company").style.display="none"' style="color:#09F;" >修改</a>
                    </li>
                    <li class="w30">快递号：<span id="change_orderNumber">${bOrder.orderNumber}</span>
                     <input name="orderNumber" class="inputbox85" type="text" id="c_orderNumber" style="display:none" value="${bOrder.orderNumber}"/> 
					<a onclick='document.getElementById("c_orderNumber").style.display="inline";document.getElementById("change_orderNumber").style.display="none"' style="color:#09F;" >修改</a>
                    </li>
                    <div id="clear"></div>
                    <li class="w40">快递日期：<span id="change_sendtime"><fmt:formatDate value="${bOrder.sendtime}" pattern="yyyy-MM-dd"/> </span>
                     <input name="sendtime"  class="inputbox85" type="text" id="c_sendtime" style="display:none" value="<fmt:formatDate value="${bOrder.sendtime}" pattern="yyyy-MM-dd"/> "/> 
					<a onclick='document.getElementById("c_sendtime").style.display="inline";applyDate("c_sendtime");document.getElementById("change_sendtime").style.display="none";' style="color:#09F;" >修改</a>
                    </li>
                    <li class="w30">收件人：<span id="change_sjr">${bOrder.sjr}</span>
                     <input name="sjr" type="text" class="inputbox85" id="c_sjr" style="display:none" value="${bOrder.sjr}"/> 
					<a onclick='document.getElementById("c_sjr").style.display="inline";document.getElementById("change_sjr").style.display="none"' style="color:#09F;" >修改</a>
                    </li>
                    <li class="w30">电话：<span id="change_contactTel">${bOrder.contactTel}</span> 
                     <input name="contactTel" class="inputbox85" type="text" id="c_contactTel" style="display:none" value="${bOrder.contactTel}"/> 
					<a onclick='document.getElementById("c_contactTel").style.display="inline";document.getElementById("change_contactTel").style.display="none"' style="color:#09F;" >修改</a>
                    </li>
                    <div id="clear"></div>
                     <li class="w40">地址：<span id="changeAddress">${bOrder.address}</span>
                      <input name="address" class="inputbox85" type="text" id="c_address" style="display:none" value="${bOrder.address}"/> 
					<a onclick='document.getElementById("c_address").style.display="inline";document.getElementById("changeAddress").style.display="none"' style="color:#09F;" >修改</a>
                    </li>
                    <div id="clear"></div>
                    </div>
                    </c:if>
                </div>
                
			<div id="check_remark">
                    <div id="title_c">
                    <li>备注：</li>
                    </div>
                    <div id="content_c">
                    <li>&nbsp;&nbsp;</li>
                    <div id="clear"></div>
                    </div>
                      <div id="title_c">
	                   <li>操作记录：</li>
	                       </div>
	                     <div id="content_c">
	                    <c:forEach var="orderLog" items="${orderLogs}"> 
	                    <li>${orderLog.operatorName}${orderLog.action}</li>
	                    </c:forEach>
	                    <div id="clear"></div>
	                    </div>
	               
                <div id="button">
                <input  type="submit" value="保存" style="width:100px; text-align:center; margin-left:100px" />
                <input  type="button" value="不保存" style="width:100px; text-align:center;margin-left:50px" />
				</div>
				</div>
</div><!--浮层结束-->
	</ul>
</form>



</body>
</html>